<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>记账</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/d3.v3.min.js"></script>
<script src="libs/nv.d3.min.js"></script>
<script src="libs/getQueryString.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h2>
					<strong>个人账册</strong>
				</h2>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="col-md-8">
			<ul class="nav nav-pills">
				<li><a href="index.html">首页</a></li>
				<li><a href="#">用户：<span id="nickname"></span></a></li>
				<button id="tuichu">用户退出</button>
			</ul>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">

			<div class="col-md-8">
				<div class="panel panel-primary">
					<div class="panel-heading">
						<p>显示</p>
					</div>
					<div class="panel-body" id="list1"></div>
				</div>
			</div>

		</div>
	</div>

	<script type="text/x-handlebars-template" id="template">
    {{#each item}}
    <div class="panel panel-default col-md-3">
      <div class="panel-body">
        <dl>
          <dt>档案号</dt> <dd>{{archive_id}}</dd>
          <dt>身份证号</dt> <dd>{{identity}}</dd>
          <dt>姓名</dt> <dd>{{name}}</dd>
          <dt>性别</dt> <dd>{{gender}}</dd>
          <dt>生日</dt> <dd>{{brithday}}</dd>
          <dt>预退休日期</dt> <dd>{{date_retire1}}</dd>
          <dt>实际退休日期</dt> <dd>{{date_retire2}}</dd>
          <dt>特殊工种</dt> <dd>{{sp}}</dd>
          <dt>女管理岗位</dt> <dd>{{fc}}</dd>
          <dt>职称</dt> <dd>{{title}}</dd>
          <dt>工龄</dt> <dd>{{seniority}}</dd>
          <a href="xiugai.html?id={{id}}" class="button">修改</a>
       </dl>
     </div>
   </div>
   {{/each}}
 </script>
	<script type="text/javascript">
		$(function() {
			$.getJSON('queryUsers.action', function(res) {
				$('#nickname').text(res.nickname);
			})

			$.getJSON('queryUsers.action', function(res) {
				$('#nickname').text(res.nickname);
			})

			$('#tuichu').click(function() {
				$.post('tuichu.action', function(res, status) {
					if ('OK' == res) {
						alert('退出成功');
						window.location.href = 'login.html'
					}
				});
			});

			$.backstretch("image/4.jpg");
			var id = getQueryString('id');
			var url = 'query.action?id=' + id;
			$.getJSON(url, function(res) {
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list1').html(t(data));
			});
		});
	</script>

</body>
</html>
